import request from '@/utils/request'
export function getData() {
  return request({
    url: 'cat'
  })
}
export function data(page) {
  return request({
    url: `/cat?_page=${page.page}&_limit=${page.pagesize}`
  })
}
export function gainData(id) {
  return request({
    url: `cat/${id}`
  })
}
export function delData(id) {
  return request({
    url: `cat/${id}`,
    method: 'delete'
  })
}
export function addData(data) {
  return request({
    url: 'cat',
    method: 'post',
    data
  })
}
export function updataData(data) {
  return request({
    url: `cat/${data.id}`,
    method: 'patch',
    data
  })
}
